//
//  YYControllerExtension.swift
//  YYProject
//
//  Created by 陆文宇 on 2017/8/23.
//  Copyright © 2017年 陆文宇. All rights reserved.
//

import UIKit

extension YYController {
    
    func yy_defaultNaviBarConfig(_ naviBar: UINavigationBar!) {
        if let naviBar = naviBar {
            naviBar.yy_normal()
            naviBar.backIndicatorImage = #imageLiteral(resourceName: "back")
            naviBar.backIndicatorTransitionMaskImage = #imageLiteral(resourceName: "back")
            naviBar.isTranslucent = false
            naviBar.barStyle = .default
            naviBar.barTintColor = mainColor
            naviBar.tintColor = .white
            naviBar.titleTextAttributes = [NSAttributedStringKey.foregroundColor: UIColor.white]
        }
    }
    
    func yy_defaultNaviItemConfig(_ naviItem: UINavigationItem) {
        let backItem = UIBarButtonItem(title: "", style: .done, target: nil, action: nil)
        naviItem.backBarButtonItem = backItem
    }
    
    func yy_defaultConfig() {
        automaticallyAdjustsScrollViewInsets = false
        navigationController?.interactivePopGestureRecognizer?.isEnabled = false
    }
    
}

